<?php
  include_once("./tool_maths.php");
/*
  $v1=array(
    array(1,1),
    array(1,2),
    array(1,20)
  );

  $v2=array(
    array(1,2),
    array(1,1),
    array(1,20)
  );
*/

  $v1=array(
    array(1,0),
    array(1,1),
    array(1,1),
    array(1,2),
    array(1,3),
    array(1,2),
    array(1,1)
  );

  $v2=array(
    array(1,1),
    array(1,1),
    array(1,2),
    array(1,3),
    array(1,2),
    array(1,0)
  );

  $dtw=new DTW();
//  $res=$dtw->__init_array_dist($v2,$v1);
  $dtw->__set_v1_v2($v1,$v2);
  $res=$dtw->__init_dtw($v1,$v2);
//  print_r($res);
  $array_res=$dtw->__get_array_res();
  print_r($dtw->__dtw2txt());
  $dtw->__trace_route();
  $res=$dtw->__get_array_route();
//  print_r($res);
//  die();
  foreach($res as $route){
    echo $dtw->__print_route($route);
    echo "\n";
    echo $dtw->__get_score_route($route);
    echo "\n";
  }
//  $test=PHP_MAX_INT;
//  echo $test+1;
?>
